package com.jml.config;

import java.util.concurrent.Executors;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

//定时调度的配置类需要实现一个父接口接口
@Configuration
public class SchedulerConfig implements SchedulingConfigurer {

	@Override
	public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
		//开启一个线程调度池，可以容纳一百个大小。
		scheduledTaskRegistrar.setScheduler(Executors.newScheduledThreadPool(100));

	}
}
